using System;
using System.Windows.Forms;
using WindowsLive.Writer.Api;

namespace InsertCodePlugin
{
	[WriterPlugin( "20EBE225-94E1-462f-BB68-04E7D24E632D", "Insert Code", "Images.InsertCode.png",
		 PublisherUrl = "http://www.shahine.com/omar",
		 Description = "Insert Code in your blog posts.")]

    [InsertableContentSource("Code")]
	public class InsertCodePlugin : ContentSource
	{
		public InsertCodePlugin()
		{
		}

		public override DialogResult CreateContent(IWin32Window dialogOwner, ref string newContent)
		{
			InsertCodeInsertForm insertForm = new InsertCodeInsertForm();
			using(insertForm)
			{
				DialogResult result = insertForm.ShowDialog();
				if(result == DialogResult.OK)
				{
                    newContent = insertForm.Code;
				}
				return result;
			}
		}
	}
}
